﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LegacyDal.Entities;

namespace LegacyDal.Managers
{
    public class UserManager
    {
        List<User> _users = new List<User>();

        public UserManager()
        {
            for (int i = 0; i < 100; ++i)
            {
                _users.Add(new User() { FirstName = "Ryan" + i.ToString(), UserName = "ryan.wright" + i.ToString() });
            }
            //_users.Add(new User() { FirstName = "Ryan", UserName = "ryan.wright" });
            //_users.Add(new User() { FirstName = "Chip", UserName = "chip.douglas" });
            //_users.Add(new User() { FirstName = "Larry", UserName = "larry.tate" });
            //_users.Add(new User() { FirstName = "Richie", UserName = "richie.cunningham" });
            //_users.Add(new User() { FirstName = "Ricky", UserName = "ricky.ricardo" });
            //_users.Add(new User() { FirstName = "Tim", UserName = "tim.taylor" });
            //_users.Add(new User() { FirstName = "Marty", UserName = "marty.mcfly" });
            //_users.Add(new User() { FirstName = "Malcom", UserName = "malcolm.reynolds" });
            //_users.Add(new User() { FirstName = "Fox", UserName = "fox.mulder" });
            //_users.Add(new User() { FirstName = "John", UserName = "john.doe" });
            //_users.Add(new User() { FirstName = "Carmine", UserName = "thebig.ragu" });
            //_users.Add(new User() { FirstName = "Ryan", UserName = "ryan.wright" });
            //_users.Add(new User() { FirstName = "Chip", UserName = "chip.douglas" });
            //_users.Add(new User() { FirstName = "Larry", UserName = "larry.tate" });
            //_users.Add(new User() { FirstName = "Richie", UserName = "richie.cunningham" });
            //_users.Add(new User() { FirstName = "Ricky", UserName = "ricky.ricardo" });
            //_users.Add(new User() { FirstName = "Tim", UserName = "tim.taylor" });
            //_users.Add(new User() { FirstName = "Marty", UserName = "marty.mcfly" });
            //_users.Add(new User() { FirstName = "Malcom", UserName = "malcolm.reynolds" });
            //_users.Add(new User() { FirstName = "Fox", UserName = "fox.mulder" });
            //_users.Add(new User() { FirstName = "John", UserName = "john.doe" });
            //_users.Add(new User() { FirstName = "Carmine", UserName = "thebig.ragu" });
            //_users.Add(new User() { FirstName = "Ryan", UserName = "ryan.wright" });
            //_users.Add(new User() { FirstName = "Chip", UserName = "chip.douglas" });
            //_users.Add(new User() { FirstName = "Larry", UserName = "larry.tate" });
            //_users.Add(new User() { FirstName = "Richie", UserName = "richie.cunningham" });
            //_users.Add(new User() { FirstName = "Ricky", UserName = "ricky.ricardo" });
            //_users.Add(new User() { FirstName = "Tim", UserName = "tim.taylor" });
            //_users.Add(new User() { FirstName = "Marty", UserName = "marty.mcfly" });
            //_users.Add(new User() { FirstName = "Malcom", UserName = "malcolm.reynolds" });
            //_users.Add(new User() { FirstName = "Fox", UserName = "fox.mulder" });
            //_users.Add(new User() { FirstName = "John", UserName = "john.doe" });
            //_users.Add(new User() { FirstName = "Carmine", UserName = "thebig.ragu" });
        }

        public List<User> GetUsersByNameAndSearch(string name, int userStatusId, int someStaticParameter, string whereClause, string orderBy, int pageIndex, int pageSize, out int rowCount)
        {
            rowCount = _users.Count;
            return _users.Skip(pageIndex * pageSize).Take(pageSize).ToList();
        }
    }
}
